package com.zjw.algorithm.gson_read;

import com.google.gson.Gson;

import java.util.ArrayList;
import java.util.List;


class User {
    List<String> stringList;

    int id;
}

public class Test {


    public static void main(String[] args) {
        Gson gson = new Gson();


        User user = new User();
        user.stringList = new ArrayList<>();
        user.stringList.add("this is string");
        user.id = 1;

        String json = gson.toJson(user);

        System.out.println(json);


        User user1 = gson.fromJson(json, User.class);
    }
}
